package com.example.demo;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class ProxyDemo {
   /** public static void main(String[] args){
        Test test=(Test) Proxy.newProxyInstance(ProxyDemo.class.getClassLoader());
        new Class[]{
                Test.class

        },new InvocationHandler(){
            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                return null;
            }

            Test target=new TestImpl();
            @Override
            public  Object invckee(Object proxy, Method method, Object[] args) throws  Throwable{
                System.out.println(method.getName()+"调用");
                return  method.invoke(target.args);
            }
        });
        System.out.println(test.hai("nihao"));
    }

    public  static  class  TestInplproxy extends  Testimpl{

    }
    private static class Test {


        public Object args;


    }

    private static class Testimpl {
    }*/
}
